<template>
	<view class="wd100bd colCen">
		<swiper class="wd100bd" style="height: 740rpx;margin-top: 30rpx;" previous-margin='130rpx' next-margin='130rpx' @change="change">
			<swiper-item v-for="(item,index) in list" :key='index'>
				<view v-if="list.length" class="item rowCenCen">
					<image class="item-img" :lazy-load="true" :src="item" :style="{ width:imgWidth}" mode=""></image>
				</view>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	import * as Api from '@/api/poster.js'
	export default {
		props: {
			imgWidth: {
				type: String,
				default: '90%'
			},
			list:Array
		},
		data() {
			return {
				current: 0,
			};
		},
		methods: {
			change(event) {
				this.current = event.detail.current
				this.$emit('change', this.current)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.item {
		height: 100%;
		transition: 1.2s;
	}

	.item-img {
		width: 416rpx;
		height: 740rpx;
		border-radius: 20rpx;
	}
</style>